package autoSpring;

import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;

public class TeacherDaoI implements TeacherDao {
    //@Autowired //按照类型注入：在spring容器中只能存在一个实例
    @Resource(name = "t2") //按照资源名称注入：在spring容器中可以存在多个相同实例不同名称
    private Teacher teacher;
    public Teacher getTeacher() {
        return teacher;
    }
}
